import { v4 as uuid } from 'uuid';

function getRandomValue(min: number, max: number) {
  return Math.random() * (max - min) + min;
}

export function generateRandomMeasurementObject() {
  return {
    sortid: 61,
    dxid: uuid(),
    label: '测量曲面.1',
    visibility: true,
    type: 'MeasureObject',
    shape: '',
    color: null,
    mark: [],
    prelinks: [],
    outlinks: [],
    baseid: '',
    children: [],
    params: {
      dxid1: 'e98c835f-8a45-4bba-9ac9-d9b7d1af0553:f0',
      dxid2: '',
      text: true,
      result: {
        area: getRandomValue(8000, 9000),
        round: getRandomValue(400, 500),
        geometry: {
          pt: [
            getRandomValue(-100, 100),
            getRandomValue(-100, 100),
            getRandomValue(-100, 100),
          ],
        },
      },
      ui: {},
    },
  } as any;
}
